// 其实就是将现有对象作为新对象的原型
function object(o) {
  function Fn() { };
  Fn.prototype = o;
  return new Fn();
}

let person = {
  name: 'wzy',
  friends: ['wz', 'zz', 'ww']
}

let p1 = object(person);
console.log(p1); // 空对象

let p2 = Object.create(person);
console.log(p2); // 空对象
console.log(p2.name);

let p3 = Object.create(person, {
  name: {
    value: 'wwwww'
  }
});
console.log(p3.name);
